/**
 * 
 */
package com.sj.szxy.courseschedule.entity.course;

import java.util.HashSet;
import java.util.Set;

import com.sj.szxy.courseschedule.entity.AdministrativeClass;
import com.sj.szxy.courseschedule.entity.ClassRoom;
import com.sj.szxy.courseschedule.entity.Segment;
import com.sj.szxy.courseschedule.entity.Subject;
import com.sj.szxy.courseschedule.entity.Teacher;

/**
 * 行政班课程
 * @author Yi Ping
 * @date 2018年3月29日 下午9:13:52 
 * @since 1.0.0
 *
 */
public abstract class AbstractSimpleCourse  implements Course  {
	
	private Subject subject;
	private Teacher teacher;
	private CourseType type;
	private ClassRoom classRoom;
	private Segment segment;
	
	
	








	/**
	 * @param subject
	 * @param teacher
	 * @param hoursPerWeek
	 * @param classRoom
	 * @param segment
	 */
	public AbstractSimpleCourse(Subject subject, Teacher teacher, CourseType courseType) {
		super();
		this.subject = subject;
		this.teacher = teacher;
		this.type = courseType;
	}
	
	
	
	
	/**
	 * @param subject
	 * @param teacher
	 */
	public AbstractSimpleCourse(Subject subject, Teacher teacher) {
		this(subject,teacher,CourseType.ONE_LESSON_PER_WEEK);
	}




	public Subject getSubject() {
		return subject;
	}
	public void setSubject(Subject subject) {
		this.subject = subject;
	}
	public Teacher getTeacher() {
		return teacher;
	}
	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}
	
	public CourseType getType() {
		return type;
	}


	public void setType(CourseType type) {
		this.type = type;
	}


	public ClassRoom getClassRoom() {
		return classRoom;
	}
	public void setClassRoom(ClassRoom classRoom) {
		this.classRoom = classRoom;
	}
	public Segment getSegment() {
		return segment;
	}
	public void setSegment(Segment segment) {
		this.segment = segment;
	}
	
	
	@Override
	public Set<Teacher> getTeachers() {
		Set<Teacher> teachers = new HashSet<>();
		teachers.add(this.teacher);
		return teachers;
	}
	
	@Override
	public Set<AdministrativeClass> getAdministractiveClasses() {
		return new HashSet<>();
	}
	
	
	@Override
	public Set<ClassRoom> getClassRooms() {
		Set<ClassRoom> rooms = new HashSet<>();
		rooms.add(this.classRoom);
		return rooms;
	}




	@Override
	public int compareTo(Course o) {
		return this.getSegment().compareTo(o.getSegment());
	}
	
	
	
	
}
